/************************************************************************/
/*																		*/
/*		School Hangover Project											*/
/*																		*/
/*		IMAC 2010														*/
/*		Author : 	Helena Duchaussoy									*/
/*					Isabelle Gouwy										*/
/*					Nathalie Kuoch										*/
/*					Franck Letellier									*/
/*					Louise Pequignot									*/
/*																		*/
/*		E-mail: flo-in-underware@googlegroups.com						*/
/*																		*/
/************************************************************************/

#include "ObjectManager.h"
#include "AbstractStage.h"

#include "Cloth.h"

#include <assert.h>

ObjectManager::ObjectManager(){
}

void ObjectManager::init(){
}

void ObjectManager::clear(){
	m_vclothes.clear();
}

void ObjectManager::addCloth(Cloth* cloth) {
	m_vclothes.push_back(cloth);
}

void ObjectManager::removeCloth(int clothID) {
	unsigned int i;
	for(i=0; i<m_vclothes.size(); i++) {
		if(m_vclothes[i]->getClothID() == clothID) break;
	}

	if(i<m_vclothes.size()) {
		m_vclothes.erase(m_vclothes.begin() + i);
	}
}
	
void ObjectManager::unlockCloth(int clothID) {
	for(size_t i=0; i< m_vclothes.size(); i++) {
		if(m_vclothes[i]->getClothID() == clothID) {
			m_vclothes[i]->setUnlocked(true);
			return;
		}
	}
}